package com.ben.multiple.websocket.entity;

/**
 * 用户类型
 *
 * @author Ben
 * @date 2020/1/7
 */
public enum UserTypeEnum {
    // 用户类型
    CUSTOM("1", "用户"),
    SERVICE("2", "客服");

    private String code;
    private String remark;

    UserTypeEnum(String code, String remark) {
        this.code = code;
        this.remark = remark;
    }

    public String getCode() {
        return code;
    }

    public String getRemark() {
        return remark;
    }

    public static UserTypeEnum getInstanceByCode(String code) {
        for (UserTypeEnum instance : values()) {
            if (instance.getCode().equals(code)) {
                return instance;
            }
        }
        return null;
    }
}
